/* 
 * File:   SimEVKnockingStrategy.h
 * Author: root
 *
 * Created on December 8, 2008, 9:27 PM
 */

#ifndef _SIMEVKNOCKINGSTRATEGY_H
#define	_SIMEVKNOCKINGSTRATEGY_H

#include "KnockingStrategy.h"

class SimEVKnockingStrategy : public KnockingStrategy {
    
    int simulationRange;
    float decisionThreshold;
    int decisionCertainty;
    
protected:
    
    virtual void setExecutionParameter(int index, int rangeFraction) {
        switch (index) {
            case 0: simulationRange = rangeFraction;
            break;
            case 1: decisionThreshold = (float) rangeFraction / 100;
            break;
        }
    }

public:
    
    SimEVKnockingStrategy() 
    : KnockingStrategy(string("SimEVKnockingStrategy"), 2), simulationRange(100), decisionThreshold(0), decisionCertainty(0) {}
    
    SimEVKnockingStrategy(int myWeight)
    : KnockingStrategy(myWeight), simulationRange(100), decisionThreshold(0), decisionCertainty(0)
    {
    }
                
    virtual int getDecisionCertainty() {
        return decisionCertainty;
    }

    virtual Strategy* getActiveInstance(int inst_weight) {
        return dynamic_cast<Strategy*>(new SimEVKnockingStrategy(inst_weight));
    }
    
    virtual void opponentMove(int opponent, const Move& move) {}
    virtual bool decideKnock(CCardStack*, const GameState*);

};

#endif	/* _SIMEVKNOCKINGSTRATEGY_H */

